# 文件搜索工具
import os

inputPath = input("输入要搜索的路径: ")
pattern = input("输入搜索的关键词: ")

# 当前路径 ， 当前路径下所有的文件夹， 当前路径下所有的文件
# for dirpath, dirnames, filenames in os.walk(inputPath):
#     print("-----------------------")
#     print(f'dirpath = {dirpath}')
#     print(f'dirnames: ')
#     for name in dirnames:
#         print(name)
#     print(f'filenames: ')
#     for name in filenames:
#         print(name)

for dirpath, _, filenames in os.walk(inputPath):
    for f in filenames:
        if pattern in f:
            print(f'{dirpath}/{f}')
